package com.ruoyi.constroller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class LoginController {

    @Autowired
    private LoginService loginService;

    // @GetMapping("sendCode")
    public AjaxResult sendCode(String mobile) {
        return loginService.sendCode(mobile);
    }

    // @GetMapping("login")
    public AjaxResult login(String mobile, String code) {
        return loginService.login(mobile, code);
    }
}
